home *** CD-ROM | disk | FTP | other *** search
/ MPEG Toolkit / MPEG Toolkit.iso / win / med-lib / mdctrl.z / MEDIADYN.BAS < prev    next >
Encoding:
BASIC Source File  |  1996-03-05  |  22.4 KB  |  356 lines

  1. Attribute VB_Name = "Module1"
  2. '* ********************************************************************** *'
  3. '* ***                        MEDIADYN.BAS                            *** *'
  4. '* ***                                                                *** *'
  5. '* ***                   Media Control Library                        *** *'
  6. '* ***         A Product of MediaDynamics Inc. (c) 1993-1995          *** *'
  7. '* ***                   ___              ___                         *** *'
  8. '* ***                  |   \            /   |                        *** *'
  9. '* ***                  |    \          /    |                        *** *'
  10. '* ***                  |     \        /     |                        *** *'
  11. '* ***                  |      \   __ /___   |                        *** *'
  12. '* ***                  |  |\   \ |       |  |\                       *** *'
  13. '* ***                  |  | \   \|  -----|  | \                      *** *'
  14. '* ***                  |  |  \   \/   /  |  |  \                     *** *'
  15. '* ***                  |  |   \      /   |  |\  \                    *** *'
  16. '* ***                  |  |    \    /    |  | |  |                   *** *'
  17. '* ***                  |  |     \  /|    |  | |  |                   *** *'
  18. '* ***                  |__|      \/ |    |__| |  |                   *** *'
  19. '* ***                            |  |         |  |                   *** *'
  20. '* ***                            |  |        /  /                    *** *'
  21. '* ***                            |  |-------/  /                     *** *'
  22. '* ***                            |____________/                      *** *'
  23. '* ***                                                                *** *'
  24. '* ***                                                                *** *'
  25. '* ***  Declaration file for using the Media Control Library within   *** *'
  26. '* ***  Microsoft Visual Basic.                                       *** *'
  27. '* ***                                                                *** *'
  28. '* ********************************************************************** *'
  29.  
  30.  
  31. ' ******************************************************************** '
  32. ' ***                                                              *** '
  33. ' ***                     Global Constants                         *** '
  34. ' ***                                                              *** '
  35. ' ******************************************************************** '
  36.  
  37. ' ******************************************************************** '
  38. ' ***  For use with the Command: mdPlay                            *** '
  39. ' ******************************************************************** '
  40. Global Const MD_PLAY_NONMODAL = 0          ' Normal mode - Play concurrently
  41. Global Const MD_PLAY_MODAL = 1             ' Modal - Play til done
  42.  
  43. ' ******************************************************************** '
  44. ' ***  For use with the Commands: mdSetCursor,                     *** '
  45. ' ***                             mdSetVideoCursor,                *** '
  46. ' ***                             mdSetCtrlCursor                  *** '
  47. ' ******************************************************************** '
  48. Global Const MD_CURSOR_BLANK = 0           ' Invisible cursor
  49. Global Const MD_CURSOR_HAND1 = 1           ' Type 1 hand cursor
  50. Global Const MD_CURSOR_HAND2 = 2           ' Type 2 hand cursor
  51. Global Const MD_CURSOR_HOURGLASS = 3       ' Wait hourglass
  52. Global Const MD_CURSOR_MAGNIFY = 4         ' Magnifying glass
  53. Global Const MD_CURSOR_QUESTPOINT = 5      ' Pointer cursor with question mark
  54. Global Const MD_CURSOR_CROSSHAIR1 = 6      ' Type 1 crosshair cursor
  55. Global Const MD_CURSOR_CROSSHAIR2 = 7      ' Type 2 crosshair cursor
  56. Global Const MD_CURSOR_CROSS = 8           ' Large cross cursor
  57. Global Const MD_CURSOR_MOVE = 9            ' left/right/up/down arrow cursor
  58.  
  59. ' ******************************************************************** '
  60. ' ***  For use with the Command: mdSetAudioLevel                   *** '
  61. ' ******************************************************************** '
  62. Global Const MD_AUDIO_MIN = 0              ' Lowest audio level
  63. Global Const MD_AUDIO_MAX = 100            ' Maximum audio level
  64.  
  65. ' ******************************************************************** '
  66. ' ***  For use with the Command: mdSetPlaybackSpeed                *** '
  67. ' ******************************************************************** '
  68. Global Const MD_PLAYBACK_MIN = 0           ' Slowest playback speed
  69. Global Const MD_PLAYBACK_NORM = 100        ' Normal playback speed
  70. Global Const MD_PLAYBACK_MAX = 200         ' Double playback speed
  71.  
  72. ' ******************************************************************** '
  73. ' ***  For use with the Command: mdGetPlayState                    *** '
  74. ' ******************************************************************** '
  75. Global Const MD_PLAYSTATE_CLOSED = 0       ' No file is open
  76. Global Const MD_PLAYSTATE_PLAYING = 1      ' File is currently playing
  77. Global Const MD_PLAYSTATE_SEEKING = 2      ' File is currently seeking to a frame
  78. Global Const MD_PLAYSTATE_PAUSED = 3       ' File is currently paused
  79. Global Const MD_PLAYSTATE_END = 4          ' File has played to the end (Of the file or specified clip)
  80. Global Const MD_PLAYSTATE_STOPPED = 5      ' File is currently stopped
  81.  
  82. ' ******************************************************************** '
  83. ' ***  For use with the Command: mdGetFileType                     *** '
  84. ' ******************************************************************** '
  85. Global Const MD_MEDIATYPE_AVI = 0         ' VfW, Indeo, Cinepak, etc.
  86. Global Const MD_MEDIATYPE_AVS = 1         ' Intel DVI (RTV or PLV)
  87. Global Const MD_MEDIATYPE_WAV = 2         ' Wave Audio (Compressed or Uncompressed
  88. Global Const MD_MEDIATYPE_MPEG = 3        ' MPEG Video
  89. Global Const MD_MEDIATYPE_QTW = 4         ' Quicktime for Windows
  90.  
  91. ' ******************************************************************** '
  92. ' ***  For use with the Commands: mdOpen and mdSetWinSize          *** '
  93. ' ******************************************************************** '
  94. Global Const MD_VIDSIZE_W_AUTOMATIC = 10  ' Width Parameter:  Automatically size the video
  95. Global Const MD_VIDSIZE_H_AUTOMATIC = 0   ' Height Parameter: Required to make the sizing automatic
  96.  
  97. ' ******************************************************************** '
  98. ' ***  For use with the Commands: mdOpen and mdSetClip             *** '
  99. ' ******************************************************************** '
  100. Global Const MD_FRAME_DEFAULT_BEG = 0     ' Automatically start the clip at the 1st frame
  101. Global Const MD_FRAME_DEFAULT_END = 0     ' Automatically end the clip on the last frame
  102.  
  103. ' ******************************************************************** '
  104. ' ***  For use with the Command: mdOpen                            *** '
  105. ' ******************************************************************** '
  106. Global Const MD_LOAD_AV_SHOW = 0          ' Preload Parameter: Load and immediately show
  107. Global Const MD_LOAD_AV_HIDDEN = 1        ' Preload Parameter: Load and keep hidden until mdShow
  108.  
  109. ' ******************************************************************** '
  110. ' ***  For use with the Commands: mdOpen and mdSetCtrlType         *** '
  111. ' ******************************************************************** '
  112. Global Const MD_CONTROL_INT_MODAL = 1     ' Shows the control bar with a close button (modal)
  113. Global Const MD_CONTROL_INT_NONMODAL = 2  ' Shows the control bar without a close button (non-modal)
  114. Global Const MD_CONTROL_INT_NONE = 3      ' Does not show the control bar (best with user defined controls)
  115.  
  116.  
  117.  
  118.  
  119. ' ******************************************************************** '
  120. ' ***                                                              *** '
  121. ' ***              Control Functions and Subroutines               *** '
  122. ' ***                                                              *** '
  123. ' ******************************************************************** '
  124.  
  125. Public Declare Function mdOpen Lib "mdCtrl32.dll" (ByVal hwndParent As Integer, ByVal szFileName As String, ByVal nXPos As Integer, ByVal nYPos As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal lBeg As Long, ByVal lEnd As Long, ByVal nType As Integer, ByVal bPreload As Integer) As Integer
  126.  
  127. ' Use the following line as a template
  128. ' ngFileHandle = mdOpen(Form.hWnd, "video.avi", nXPos, nYPos, VIDSIZE_W_AUTOMATIC, VIDSIZE_H_AUTOMATIC, FRAME_DEFAULT_BEG, FRAME_DEFAULT_END, CONTROL_INT_NONMODAL, LOAD_AV_SHOW)
  129.  
  130. Public Declare Function mdOpenLite Lib "mdCtrl.dll" (ByVal hwndParent As Integer, ByVal szFileName As String, ByVal nXPos As Integer, ByVal nYPos As Integer, ByVal bCtrl As Integer) As Integer
  131.  
  132. Declare Function mdClose Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  133. Declare Sub mdPlay Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal bModal As Integer)
  134. Declare Sub mdPause Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  135.  
  136. Declare Sub mdStep Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  137. Declare Sub mdStop Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  138.  
  139. Declare Sub mdGotoFrame Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal dwGotoFrame As Long)
  140. Declare Sub mdRewind Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  141. Declare Sub mdRestart Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  142.  
  143.  
  144.  
  145. ' ******************************************************************** '
  146. ' ***                                                              *** '
  147. ' ***                Window Control Subroutines                    *** '
  148. ' ***                                                              *** '
  149. ' ******************************************************************** '
  150.  
  151. Declare Sub mdHide Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  152. Declare Sub mdShow Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  153.  
  154. Declare Sub mdHideVideo Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  155. Declare Sub mdShowVideo Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  156.  
  157. Declare Sub mdHideCtrl Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  158. Declare Sub mdShowCtrl Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  159.  
  160.  
  161. ' ******************************************************************** '
  162. ' ***                                                              *** '
  163. ' ***          Parameter Setting Functions and Subroutines         *** '
  164. ' ***                                                              *** '
  165. ' ******************************************************************** '
  166.  
  167. Declare Sub mdSetClip Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal dwBeg As Long, ByVal dwEnd As Long)
  168.  
  169. Declare Sub mdSetWinPos Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal xPos As Integer, ByVal yPos As Integer)
  170. Declare Sub mdSetWinSize Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer)
  171.  
  172. Declare Sub mdSetVideoWinPos Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal xPos As Integer, ByVal yPos As Integer)
  173. Declare Sub mdSetVideoWinSize Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer)
  174.  
  175. Declare Sub mdSetCtrlWinPos Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal xPos As Integer, ByVal yPos As Integer)
  176. Declare Sub mdSetCtrlWinSize Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nWidth As Integer)
  177.  
  178. Declare Sub mdSetWindowMoveable Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal bMoveable As Integer)
  179. Declare Sub mdSetWindowInteractive Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal binteract As Integer)
  180.  
  181. Declare Sub mdSetAudioLevel Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nAudioLevel As Integer)
  182. Declare Sub mdSetAudioMute Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  183.  
  184. Declare Sub mdSetCtrlType Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nType As Integer)
  185.  
  186. Declare Sub mdSetWinTop Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  187. Declare Sub mdSetWinBottom Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  188. Declare Sub mdSetNewParent Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal hNewParent As Integer)
  189.  
  190. Declare Sub mdSetClippingRegion Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nXPos As Integer, ByVal nYPos As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal nDisplayFlag As Integer)
  191.  
  192. Declare Sub mdSetVideoAspect Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nXPos As Integer, ByVal nYPos As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal nJustify As Integer, ByVal bLimitFlag As Integer)
  193. Declare Sub mdSetVideoOffset Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nDown As Integer, ByVal nRight As Integer)
  194. Declare Sub mdSetVideoPalette Lib "mdCtrl.dll" (ByVal bPalFlag As Integer)
  195. Declare Sub mdSetKeyColor Lib "mdCtrl.dll" (ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer)
  196.  
  197. Declare Sub mdSetPlaybackSpeed Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nPlaybackSpeed As Integer)
  198.  
  199.  
  200. ' ******************************************************************** '
  201. ' ***                                                              *** '
  202. ' ***            Informational Functions and Subroutines           *** '
  203. ' ***                                                              *** '
  204. ' ******************************************************************** '
  205.  
  206. Declare Function mdGetFileType Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  207. Declare Function mdGetWindowHandle Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  208. Declare Function mdGetDeviceID Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  209. Declare Function mdGetFrame Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Long
  210. Declare Function mdGetClipFrame Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Long
  211.  
  212. Declare Function mdGetLength Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Long
  213. Declare Function mdGetClipLength Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Long
  214.  
  215. Declare Function mdGetPlayState Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  216. Declare Function mdGetDisplayState Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  217.  
  218. Declare Sub mdGetWinPos Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, nXPos As Integer, nYPos As Integer)
  219. Declare Sub mdGetWinSize Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, nWidth As Integer, nHeight As Integer)
  220.  
  221. Declare Function mdGetWinX Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  222. Declare Function mdGetWinY Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  223. Declare Function mdGetWinWidth Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  224. Declare Function mdGetWinHeight Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  225.  
  226. Declare Sub mdGetVideoWinPos Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, xPos As Integer, yPos As Integer)
  227. Declare Sub mdGetVideoWinSize Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, nWidth As Integer, nHeight As Integer)
  228.  
  229. Declare Function mdGetVideoWinX Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  230. Declare Function mdGetVideoWinY Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  231. Declare Function mdGetVideoWinWidth Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  232. Declare Function mdGetVideoWinHeight Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  233.  
  234. Declare Sub mdGetCtrlWinPos Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, xPos As Integer, yPos As Integer)
  235. Declare Sub mdGetCtrlWinSize Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, nWidth As Integer)
  236.  
  237. Declare Function mdGetCtrlWinX Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  238. Declare Function mdGetCtrlWinY Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  239. Declare Function mdGetCtrlWinWidth Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  240.  
  241. Declare Function mdGetAreaClicked Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  242. Declare Function mdGetOpenFileCount Lib "mdCtrl.dll" () As Integer
  243.  
  244. Declare Function mdGetFrameRate Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  245.  
  246. Declare Function mdGetPlayedStatus Lib "mdCtrl.dll" (ByVal nFileHandle As Integer) As Integer
  247.  
  248.  
  249. ' ******************************************************************** '
  250. ' ***                                                              *** '
  251. ' ***               Graphics Functions and Subroutines             *** '
  252. ' ***                                                              *** '
  253. ' ******************************************************************** '
  254. Declare Function mdOpenGraphic Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal FileNameIn As String) As Integer
  255. Declare Function mdOpenGraphicKeep Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal FileNameIn As String) As Integer
  256. Declare Function mdShowGraphic Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal bShowPalette As Integer) As Integer
  257. Declare Function mdShowGraphicPos Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal nXPos As Integer, ByVal nYPos As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bShowPalette As Integer) As Integer
  258. Declare Sub mdHideGraphic Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  259. Declare Sub mdCloseGraphic Lib "mdCtrl.dll" (ByVal nFileHandle As Integer)
  260. Declare Function mdDisplayGraphic Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal FileNameIn As String, ByVal nXPos As Integer, ByVal nYPos As Integer, ByVal bShowPalette As Integer) As Integer
  261.  
  262.  
  263. ' ******************************************************************** '
  264. ' ***                                                              *** '
  265. ' ***            Cursor Control Functions and Subroutines          *** '
  266. ' ***                                                              *** '
  267. ' ******************************************************************** '
  268. Declare Sub mdSetCursor Lib "mdCtrl.dll" (ByVal nCursorNo As Integer)
  269. Declare Sub mdResetCursor Lib "mdCtrl.dll" ()
  270. Declare Sub mdSetVideoCursor Lib "mdCtrl.dll" (ByVal nCursorNo As Integer)
  271. Declare Sub mdResetVideoCursor Lib "mdCtrl.dll" ()
  272. Declare Sub mdSetCtrlCursor Lib "mdCtrl.dll" (ByVal nCursorNo As Integer)
  273. Declare Sub mdResetCtrlCursor Lib "mdCtrl.dll" ()
  274.                                
  275.  
  276. ' ******************************************************************** '
  277. ' ***                                                              *** '
  278. ' ***            Miscellaneous Functions and Subroutines           *** '
  279. ' ***                                                              *** '
  280. ' ******************************************************************** '
  281. Declare Sub mdTimedDelay Lib "mdCtrl.dll" (ByVal seconds As Single)
  282. Declare Function mdFileDoesNotExist Lib "mdCtrl.dll" (ByVal FileToCheck As String) As Integer
  283. Declare Function mdFileDoesExist Lib "mdCtrl.dll" (ByVal FileToCheck As String) As Integer
  284. Declare Sub mdDisplayErrorMsgs Lib "mdCtrl.dll" (ByVal bErrMsgFlag As Integer)
  285. Declare Sub mdCDEject Lib "mdCtrl.dll" (ByVal bEject As Integer)
  286. Declare Sub mdAbout Lib "mdCtrl.dll" ()
  287.  
  288. Declare Function mdMCISendString Lib "mdCtrl.dll" (ByVal nFileHandle As Integer, ByVal szMCIString As String) As Long
  289.  
  290. ' ***************************************************************** '
  291. ' ***                       sbrGetColor                         *** '
  292. ' ***                                                           *** '
  293. ' ***   Description:  This routine accepts an RGB color in a    *** '
  294. ' ***    long integer and extracts out the Red, Green and Blue  *** '
  295. ' ***    components.                                            *** '
  296. ' ***                                                           *** '
  297. ' ***    The nRed, nGreen and nBlue variables are passed by     *** '
  298. ' ***    reference so all three can be modified at one time     *** '
  299. ' ***                                                           *** '
  300. ' ***   Type: Subroutine                                        *** '
  301. ' ***                                                           *** '
  302. ' ***   Parameters:                                             *** '
  303. ' ***      lColor : Long    : Color Value                       *** '
  304. ' ***      nRed   : Integer : Red Component   (value returned)  *** '
  305. ' ***      nGreen : Integer : Green Component (value returned)  *** '
  306. ' ***      nBlue  : Integer : Blue Component  (value returned)  *** '
  307. ' ***                                                           *** '
  308. ' ***************************************************************** '
  309. '
  310. Sub sbrGetColor(ByVal lColor&, nRed%, nGreen%, nBlue%)
  311.  
  312.     nRed = lColor And 255                       ' Low order byte
  313.  
  314.     nGreen = CInt((lColor And 65280) / 256)     ' Middle byte
  315.  
  316.     nBlue = CInt((lColor And 16711680) / 65536) ' Third byte
  317.  
  318. End Sub
  319.  
  320. ' ***************************************************************** '
  321. ' ***                    szfuncFormatTime                       *** '
  322. ' ***                                                           *** '
  323. ' ***   Description:  This function formats and returns a       *** '
  324. ' ***    string with the time calculated from the passed frame  *** '
  325. ' ***    number and the frame rate in frames per second.        *** '
  326. ' ***    Format: "00:00:00.00"                                  *** '
  327. ' ***                                                           *** '
  328. ' ***   Type: String                                            *** '
  329. ' ***                                                           *** '
  330. ' ***   Parameters:                                             *** '
  331. ' ***      lFrameNo   : Long    : Current frame number          *** '
  332. ' ***      nFrameRate : Integer : Frame rate of the file        *** '
  333. ' ***                                                           *** '
  334. ' ***************************************************************** '
  335. '
  336. Function szfuncFormatTime$(ByVal lFrameNo As Long, ByVal nFrameRate As Integer)
  337.  
  338.     Dim lFrames&, lSeconds&, lMinutes&, lHours&
  339.  
  340.     ' These calulations are based on the
  341.     ' playback rate of the video or audio
  342.  
  343.     If nFrameRate Then
  344.         lFrames = lFrameNo Mod nFrameRate                  ' Number of extra frames
  345.         lSeconds = Int(lFrameNo / nFrameRate)              ' Total Full Seconds
  346.         lHours = Int(lSeconds / 3600)                      ' Hours
  347.         lMinutes = Int((lSeconds - (lHours * 3600)) / 60)  ' Minutes
  348.         lSeconds = lSeconds Mod 60                         ' Seconds
  349.     End If
  350.     
  351.     ' Format the string into "00:00:00.00" format
  352.     szfuncFormatTime = Format$(lHours, "00") & ":" & Format$(lMinutes, "00") & ":" & Format$(lSeconds, "00") & "." & Format$(lFrames, "00")
  353.  
  354. End Function
  355.  
  356.